<%@ page import="com.goal98.team.Constants" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main"/>
    <title><g:message code="activity.show" default="Show Activity"/>--${activityInstance}</title>


    <style type="text/css">
    .dialog1 table {
      padding: 5px 0;
    }
    </style>
  </head>
  <body>
    <div class="nav">
      %{--<span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>--}%
      <span class="menuButton"><g:link class="list" action="list"><g:message code="activity.list" default="Activity List"/></g:link></span>
      <g:ifAnyGranted role="${Constants.ROLE_TEAM_ADMIN}">
        <span class="menuButton"><g:link class="create" action="create"><g:message code="activity.new" default="New Activity"/></g:link></span>
      </g:ifAnyGranted>
    </div>
    <div class="body">
      <h1><g:message code="activity.show" default="Show Activity"/></h1>
      <g:if test="${flash.message}">
        <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
      </g:if>
      <g:form>
        <g:hiddenField name="id" value="${activityInstance?.id}"/>
        <div class="dialog1">
          <table>
            <tbody>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.team" default="Team"/>:</td>

                <td valign="top" class="value">${activityInstance?.team?.encodeAsHTML()}</td>

              </tr>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.activityTime" default="Activity Time"/>:</td>

                <td valign="top" class="value"><g:formatDate date="${activityInstance?.activityTime}"/></td>

              </tr>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.venue" default="Venue"/>:</td>

                <td valign="top" class="value">
                  <g:link controller="venue" action="show" id="${activityInstance?.venue?.id}">
                    ${activityInstance?.venue?.encodeAsHTML()}
                  </g:link>
                </td>

              </tr>

              <tr class="prop">
                <td valign="top" class="name"><g:message code="activity.description" default="Description"/>:</td>

                <td valign="top" class="value">${fieldValue(bean: activityInstance, field: "description")}</td>

              </tr>

            </tbody>
          </table>
        </div>

        <g:render template="costs" model="[activityInstance:activityInstance]"/>

        <g:render template="attendPerson" model="[activityInstance:activityInstance]"/>

        <div class="buttons">
          <g:ifAnyGranted role="${Constants.ROLE_TEAM_ADMIN}">
            <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'button.edit', 'default': 'Edit')}"/></span>
          %{--<span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'delete', 'default': 'Delete')}" onclick="return confirm('${message(code: 'delete.confirm', 'default': 'Are you sure?')}');"/></span>--}%
          </g:ifAnyGranted>
        </div>
      </g:form>
    </div>
  </body>
</html>
